package com.fyy.service;

import com.fyy.model.User;
import feign.hystrix.FallbackFactory;

import java.util.List;

/**
 * @Author fyy
 * @Description
 * @Date 2020/6/28 16:30
 */
public class IUserServiceFallFatory implements FallbackFactory {

    public IUserService create(Throwable throwable) {
        return new IUserService() {
            public boolean addUser(User user) {
                return false;
            }

            public User queryUserById(Long id) {
                return new User().setUsername("未查询到用户");
            }

            public List<User> queryUserList() {
                return null;
            }
        };
    }
}
